﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace com.cgWorkstudio.BIMP.Library.uc {
    public partial class UC_NavButton:UserControl {
        public UC_NavButton() {
            InitializeComponent();
            this.showHiddenPicPanel.MouseMove += new MouseEventHandler(showHiddenPicPanel_MouseMove);
            this.showHiddenPicPanel.MouseLeave += new EventHandler(showHiddenPicPanel_MouseLeave);
            this.showHiddenPicPanel.MouseDown += new MouseEventHandler(showHiddenPicPanel_MouseDown);
            this.showHiddenPicPanel.MouseUp += new MouseEventHandler(showHiddenPicPanel_MouseUp);

            this.showButtonText.MouseMove += new MouseEventHandler(showHiddenPicPanel_MouseMove);
            this.showButtonText.MouseLeave += new EventHandler(showHiddenPicPanel_MouseLeave);
            this.showButtonText.MouseDown += new MouseEventHandler(showHiddenPicPanel_MouseDown);
            this.showButtonText.MouseUp += new MouseEventHandler(showHiddenPicPanel_MouseUp);
        }

        void showHiddenPicPanel_MouseUp(object sender,MouseEventArgs e) {
            mouseMoving = true;
            this.showButtonText.Padding = new Padding(0);
        }

        void showHiddenPicPanel_MouseDown(object sender,MouseEventArgs e) {
            mouseMoving = true;
            this.showButtonText.Padding = new Padding(0,1,0,0);
        }

        void showHiddenPicPanel_MouseLeave(object sender,EventArgs e) {
            mouseMoving = false;
            this.showButtonText.BackColor = Color.Transparent;
            this.showButtonText.Padding = new Padding(0);
            this.showButtonText.Font = new Font(this.Font,FontStyle.Regular);
        }
        bool mouseMoving = false;
        void showHiddenPicPanel_MouseMove(object sender,MouseEventArgs e) {
            if(mouseMoving == true) {
                return;
            }
            mouseMoving = true;
            this.showButtonText.BackColor = Color.FromArgb(253,199,176);
            this.showButtonText.Font = new Font(this.Font,FontStyle.Bold);
        }
        [Description("按钮文本")]
        public string CGNavText {
            get {
                return showButtonText.Text;
            }
            set {
                showButtonText.Text = value;
            }
        }
    }
}
